<%- for news in @news -%>
<%- if @helddate != news.created_at.yday -%>
<%- content_tag :div, :class => 'border' do -%>
<%- if( Date.today.yday==news.created_at.yday ) -%> Updated today
<%- elsif( Date.yesterday.yday == news.created_at.yday ) -%> Updated yesterday
<%- else -%>Updated <%= news.created_at.beginning_of_day().strftime("%a, %b %d %Y") -%><%- end -%>
<%- end -%>
<%- end -%>
<%- @helddate = news.created_at.yday -%>
<%- if news.class == ActionItemEntry -%>
	<% content_tag :div, :class => 'container action_item' do -%>
		<%= content_tag :img, nil, :src => '/images/icons/icons_10.png', :class => 'icon' %>
		<% content_tag :div, :class => 'center' do %>
			<% content_tag :div, :class => 'title' do %>
				<%= link_to news.name, {:controller => :projects, :action => :edit, :id => news.action_item_id} %>
				<%= content_tag :span, ' was updated by ' %>
				<%= link_to news.created_by.fname, :controller => :groups %>
			<% end %>
			<%= content_tag :div, news.note, :class => 'text' %>
		<%- end -%>
	<%- end -%>
<%- end -%>
<%- if news.class == ProjectEntry -%>
	<% content_tag :div, :class => 'container project' do -%>
		<%= content_tag :img, nil, :src => '/images/icons/icons_27.png',:class => 'icon' %>
		<% content_tag :div, :class => 'center' do %>
			<% content_tag :div, :class => 'title' do %>
				<%= link_to news.name, {:controller => :projects, :action => :edit_project, :id => news.project_id} %>
				<%= content_tag :span, ' was updated by ' %>
				<%= link_to news.created_by.fname, :controller => :groups %>
			<% end %>
			<%= content_tag :div, news.note, :class => 'text' %>
			<% if news.status == 'Closed' -%>
				<%= content_tag :div, 'This project has been closed!', :class => 'closed' %>
			<% end -%>
		<%- end -%>
	<%- end -%>
<%- end -%>
<%- if news.class == ContactEntry -%>
	<% content_tag :div, :class => 'container contact' do -%>
		<%= content_tag :img, nil, :src => '/images/icons/icons_71.png',:class => 'icon' %>
		<% content_tag :div, :class => 'center' do %>
			<% content_tag :div, :class => 'title' do %>
				<%= link_to news.fname+" "+news.lname, {:controller => :contacts, :action => :edit, :id => news.contact_id} %>
				<%= content_tag :span, ' was updated by ' %>
				<%= link_to news.created_by.fname, :controller => :groups %>
			<% end %>
			<%= content_tag :div, news.note, :class => 'text' %>
		<%- end -%>
	<%- end -%>
<%- end -%>
<%- if news.class == Announcement -%>
	<% content_tag :div, :class => 'container announcement' do -%>
		<%= content_tag :img, nil, :src => '/images/icons/icons_14.png',:class => 'icon' %>
		<% content_tag :div, :class => 'center' do %>
			<% content_tag :div, :class => 'title' do %>
				<%= link_to news.title, {:controller => :community, :action => :show, :id => news.id} %>
			<% end %>
			<%= link_to 'community news', {:contoller => :community, :action => :index },:class => 'titler' %>
			<%= content_tag :div, news.body, :class => 'text' %>
		<%- end -%>
	<%- end -%>
<%- end -%>
<%- if news.class == FundEntry -%>
	<% content_tag :div, :class => 'container fund' do -%>
		<%= content_tag :img, nil,:src => '/images/icons/icons_56.png', :class => 'icon' %>
		<% content_tag :div, :class => 'center' do %>
			<% content_tag :div, :class => 'title' do %>
				<%= link_to news.name, {:controller => :finances, :action => :edit_fund, :id => news.fund_id} %>
				<%= content_tag :span, ' was updated by ' %>
				<%= link_to news.created_by.fname, :controller => :groups %>
			<% end %>
			<%= content_tag :div, news.note, :class => 'text' %>
		<%- end -%>
	<%- end -%>
<%- end -%>
<%- if news.class == LineItemEntry -%>
	<% content_tag :div, :class => 'container line_item' do -%>
		<%= content_tag :img, nil, :src => '/images/icons/icons_42.png',:class => 'icon' %>
		<% content_tag :div, :class => 'center' do %>
			<% content_tag :div, :class => 'title' do %>
				<%= link_to news.name, {:controller => :finances, :action => :edit, :id => news.line_item_id} %>
				<%= content_tag :span, ' was updated by ' %>
				<%= link_to news.created_by.fname, :controller => :groups %>
			<% end %>
			<%= content_tag :div, news.note, :class => 'text' %>
		<%- end -%>
	<%- end -%>
<%- end -%>
<%- end -%>
